#include<iostream>
#include<cstdio>
using namespace std;
int Average(int a[]){
	int min=0,max=0;
	double average,sum=0;
	for(int i=0;i<9;i++){
		if(a[i]>a[max])
		max=i;
		else{
			if(a[i]<a[min])
			min=i;
		}
	}
	for(int i=0;i<9;i++){
		if(i!=min&&i!=max)
		sum+=a[i];
	}
	average=sum/7;
	return average;
}
int main(){
	double average;
	int a[]={1,3,2,4,6,5,8,7,9};
	average=Average(a);
	cout<<average;
	return 0;
}
